home *** CD-ROM | disk | FTP | other *** search
/ Champak 119 / (Vol 119) Nov 09 2010.iso / TGKI-109 / Games / snack_attack.swf / scripts / DefineSprite_233 / frame_17 / DoAction.as
Text File  |  2010-11-09  |  541b  |  32 lines

  1. i = "1";
  2. found = "0";
  3. while(i < "5")
  4. {
  5.    if(getProperty("r" add i, _currentframe) == "1")
  6.    {
  7.       found += "1";
  8.       set("item" add found,"r" add i);
  9.    }
  10.    i += "1";
  11. }
  12. if(found == "0")
  13. {
  14.    i = "1";
  15.    while(i < "3")
  16.    {
  17.       if(getProperty("l" add i, _currentframe) == "1")
  18.       {
  19.          found += "1";
  20.          set("item" add found,"l" add i);
  21.       }
  22.       i += "1";
  23.    }
  24. }
  25. toDrop = eval("item" add (random(found) + "1"));
  26. items -= "1";
  27. tellTarget(toDrop)
  28. {
  29.    gotoAndStop("right");
  30.    play();
  31. }
  32.